package Test;

import java.util.Scanner;

/*public class Main {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int num = input.nextInt();
    }
    public static int reversalNum(int num){

        return num;
    }
}*/

//反序输出一个整数
/*
public class Main {

    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int num = input.nextInt();
        reversalNum(num);
    }


    public static void reversalNum(int num) {
        int anserNum = 0;
        int PositiveNum = Math.abs(num);
        int e = PositiveNum;

        while (PositiveNum > 0) {
            anserNum *= 10;
            anserNum += PositiveNum % 10;
            PositiveNum /= 10;
        }
        if (num < 0) {
            anserNum = -anserNum;
        }

        System.out.println(anserNum);

    }

}*/
import java.util.*;

/*
public class Main {

    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int[][] arr = new int[n][3];
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < 3; j++) {
                arr[i][j] = input.nextInt();
            }
        }

        System.out.println(getWrongNum(arr));
    }

    private static int getWrongNum(int[][] arr) {
        int wrongNum = 0;
        for (int i = 0; i < arr.length; ++i) {
            for (int j = 0; j < arr.length; ++j) {
                if (arr[i][0] < arr[j][0] && arr[i][1] < arr[j][1] && arr[i][2] < arr[j][2]) {
                    wrongNum++;
                    break;
                }
            }
        }
        return wrongNum;
    }
}*/
import java.util.ArrayList;
import java.util.Scanner;

public class Main08 {

    public static int MAX = 1000;
    public static int[][] map = new int[MAX][MAX];
    public static ArrayList<String> result = new ArrayList<String>();

    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int t=input.nextInt();
        for(int k=0;k<t;k++) {
            int n = input.nextInt();
            int m = input.nextInt();
            int[] degree = new int[n];
            for (int i = 0; i < m; i++) {
                int a = input.nextInt();
                int b = input.nextInt();
                map[a - 1][b - 1] = 1;
                map[b - 1][a - 1] = 1;
                degree[a - 1]++;
                degree[b - 1]++;
            }
            if (function(degree) && function2(n))
                result.add("Yes");
            else
                result.add("No");
        }


        for (int i = 0; i < result.size(); i++)
            System.out.println(result.get(i));

    }
    //判断给定图的每个顶点的度是否均为偶数
    public static boolean function(int[] degree) {
        for(int i = 0;i < degree.length;i++) {
            if(degree[i] % 2 != 0)
                return false;
        }
        return true;
    }

    //使用BFS遍历，判断给定图是否为连通图
    public static boolean function2(int n) {
        boolean[] used = new boolean[n];
        ArrayList<Integer> list = new ArrayList<Integer>();
        list.add(0);
        used[0] = true;
        while(!list.isEmpty()) {
            int temp = list.get(0);
            list.remove(0);
            for(int i = 0;i < n;i++) {
                if(!used[i] && map[temp][i] != 0) {
                    used[i] = true;
                    list.add(i);
                }
            }
        }
        for(int i = 0;i < n;i++) {
            if(used[i] == false)
                return false;
        }
        return true;
    }


}